
/* A Bison parser, made by GNU Bison 2.4.1.  */

/* Skeleton implementation for Bison LALR(1) parsers in C++
   
      Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
   Foundation, Inc.
   
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

/* As a special exception, you may create a larger work that contains
   part or all of the Bison parser skeleton and distribute that work
   under terms of your choice, so long as that work isn't itself a
   parser generator using the skeleton or a modified version thereof
   as a parser skeleton.  Alternatively, if you modify or redistribute
   the parser skeleton itself, you may (at your option) remove this
   special exception, which will cause the skeleton and the resulting
   Bison output files to be licensed under the GNU General Public
   License without this special exception.
   
   This special exception was added by the Free Software Foundation in
   version 2.2 of Bison.  */


/* First part of user declarations.  */

/* Line 311 of lalr1.cc  */
#line 27 "alice.yy"


#include "../MAliceDriver.hpp"
#define yylex driver.getScanner()->scan

#include "../Ast/Ast.h"
#include "../Ast/ErrorAst.h"
#include "../Ast/ExpressionAst.h"
#include "../Ast/IntegerLiteralAst.h"
#include "../Ast/CharacterLiteralAst.h"
#include "../Ast/BinaryOperatorAst.h"
#include "../Ast/BinaryAddOperatorAst.h"
#include "../Ast/BinaryMulOperatorAst.h"
#include "../Ast/BinarySubOperatorAst.h"
#include "../Ast/BinaryDivOperatorAst.h"
#include "../Ast/BinaryModOperatorAst.h"
#include "../Ast/BinaryAndOperatorAst.h"
#include "../Ast/BinaryXorOperatorAst.h"
#include "../Ast/BinaryOrOperatorAst.h"
#include "../Ast/AssignmentOperatorAst.h"

#include "../Ast/UnaryAteOperatorAst.h"
#include "../Ast/UnaryDrankOperatorAst.h"
#include "../Ast/UnaryNegOperatorAst.h"
#include "../Ast/UnaryNotOperatorAst.h"
#include "../Ast/FloatLiteralAst.h"

#include "../Ast/ReturnExpressionAst.h"
#include "../Ast/VariableDeclAst.h"
#include "../Ast/VariableAst.h"
#include "../Ast/TypeAst.h"

using namespace MAlice;



/* Line 311 of lalr1.cc  */
#line 78 "MAliceParser.cpp"


#include "MAliceParser.hpp"

/* User implementation prologue.  */


/* Line 317 of lalr1.cc  */
#line 87 "MAliceParser.cpp"

#ifndef YY_
# if YYENABLE_NLS
#  if ENABLE_NLS
#   include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
#   define YY_(msgid) dgettext ("bison-runtime", msgid)
#  endif
# endif
# ifndef YY_
#  define YY_(msgid) msgid
# endif
#endif

/* Suppress unused-variable warnings by "using" E.  */
#define YYUSE(e) ((void) (e))

/* Enable debugging if requested.  */
#if YYDEBUG

/* A pseudo ostream that takes yydebug_ into account.  */
# define YYCDEBUG if (yydebug_) (*yycdebug_)

# define YY_SYMBOL_PRINT(Title, Type, Value, Location)	\
do {							\
  if (yydebug_)						\
    {							\
      *yycdebug_ << Title << ' ';			\
      yy_symbol_print_ ((Type), (Value), (Location));	\
      *yycdebug_ << std::endl;				\
    }							\
} while (false)

# define YY_REDUCE_PRINT(Rule)		\
do {					\
  if (yydebug_)				\
    yy_reduce_print_ (Rule);		\
} while (false)

# define YY_STACK_PRINT()		\
do {					\
  if (yydebug_)				\
    yystack_print_ ();			\
} while (false)

#else /* !YYDEBUG */

# define YYCDEBUG if (false) std::cerr
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_REDUCE_PRINT(Rule)
# define YY_STACK_PRINT()

#endif /* !YYDEBUG */

#define yyerrok		(yyerrstatus_ = 0)
#define yyclearin	(yychar = yyempty_)

#define YYACCEPT	goto yyacceptlab
#define YYABORT		goto yyabortlab
#define YYERROR		goto yyerrorlab
#define YYRECOVERING()  (!!yyerrstatus_)


/* Line 380 of lalr1.cc  */
#line 1 "[Bison:b4_percent_define_default]"

namespace yy {

/* Line 380 of lalr1.cc  */
#line 156 "MAliceParser.cpp"
#if YYERROR_VERBOSE

  /* Return YYSTR after stripping away unnecessary quotes and
     backslashes, so that it's suitable for yyerror.  The heuristic is
     that double-quoting is unnecessary unless the string contains an
     apostrophe, a comma, or backslash (other than backslash-backslash).
     YYSTR is taken from yytname.  */
  std::string
  MAliceParser::yytnamerr_ (const char *yystr)
  {
    if (*yystr == '"')
      {
        std::string yyr = "";
        char const *yyp = yystr;

        for (;;)
          switch (*++yyp)
            {
            case '\'':
            case ',':
              goto do_not_strip_quotes;

            case '\\':
              if (*++yyp != '\\')
                goto do_not_strip_quotes;
              /* Fall through.  */
            default:
              yyr += *yyp;
              break;

            case '"':
              return yyr;
            }
      do_not_strip_quotes: ;
      }

    return yystr;
  }

#endif

  /// Build a parser object.
  MAliceParser::MAliceParser (MAliceDriver& driver_yyarg)
    :
#if YYDEBUG
      yydebug_ (false),
      yycdebug_ (&std::cerr),
#endif
      driver (driver_yyarg)
  {
  }

  MAliceParser::~MAliceParser ()
  {
  }

#if YYDEBUG
  /*--------------------------------.
  | Print this symbol on YYOUTPUT.  |
  `--------------------------------*/

  inline void
  MAliceParser::yy_symbol_value_print_ (int yytype,
			   const semantic_type* yyvaluep, const location_type* yylocationp)
  {
    YYUSE (yylocationp);
    YYUSE (yyvaluep);
    switch (yytype)
      {
         default:
	  break;
      }
  }


  void
  MAliceParser::yy_symbol_print_ (int yytype,
			   const semantic_type* yyvaluep, const location_type* yylocationp)
  {
    *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
	       << ' ' << yytname_[yytype] << " ("
	       << *yylocationp << ": ";
    yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
    *yycdebug_ << ')';
  }
#endif

  void
  MAliceParser::yydestruct_ (const char* yymsg,
			   int yytype, semantic_type* yyvaluep, location_type* yylocationp)
  {
    YYUSE (yylocationp);
    YYUSE (yymsg);
    YYUSE (yyvaluep);

    YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);

    switch (yytype)
      {
        case 3: /* "\"id\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 263 "MAliceParser.cpp"
	break;
      case 4: /* "\"bool\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 272 "MAliceParser.cpp"
	break;
      case 5: /* "\"char\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 281 "MAliceParser.cpp"
	break;
      case 6: /* "\"int\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 290 "MAliceParser.cpp"
	break;
      case 7: /* "\"float\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 299 "MAliceParser.cpp"
	break;
      case 8: /* "\"string\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 308 "MAliceParser.cpp"
	break;
      case 9: /* "\"<<\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 317 "MAliceParser.cpp"
	break;
      case 10: /* "\">>\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 326 "MAliceParser.cpp"
	break;
      case 11: /* "\"<=\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 335 "MAliceParser.cpp"
	break;
      case 12: /* "\">=\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 344 "MAliceParser.cpp"
	break;
      case 13: /* "\"==\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 353 "MAliceParser.cpp"
	break;
      case 14: /* "\"!=\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 362 "MAliceParser.cpp"
	break;
      case 15: /* "\"a\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 371 "MAliceParser.cpp"
	break;
      case 16: /* "\"and\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 380 "MAliceParser.cpp"
	break;
      case 17: /* "\"Alice\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 389 "MAliceParser.cpp"
	break;
      case 18: /* "\"became\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 398 "MAliceParser.cpp"
	break;
      case 19: /* "\"found\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 407 "MAliceParser.cpp"
	break;
      case 20: /* "\"was\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 416 "MAliceParser.cpp"
	break;
      case 21: /* "\"but\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 425 "MAliceParser.cpp"
	break;
      case 22: /* "\"too\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 434 "MAliceParser.cpp"
	break;
      case 23: /* "\"ate\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 443 "MAliceParser.cpp"
	break;
      case 24: /* "\"drank\"" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 452 "MAliceParser.cpp"
	break;
      case 41: /* "literal" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 461 "MAliceParser.cpp"
	break;
      case 42: /* "type_id" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 470 "MAliceParser.cpp"
	break;
      case 43: /* "primary_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 479 "MAliceParser.cpp"
	break;
      case 44: /* "postfix_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 488 "MAliceParser.cpp"
	break;
      case 45: /* "unary_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 497 "MAliceParser.cpp"
	break;
      case 46: /* "cast_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 506 "MAliceParser.cpp"
	break;
      case 47: /* "multiplicative_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 515 "MAliceParser.cpp"
	break;
      case 48: /* "additive_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 524 "MAliceParser.cpp"
	break;
      case 49: /* "shift_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 533 "MAliceParser.cpp"
	break;
      case 50: /* "relational_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 542 "MAliceParser.cpp"
	break;
      case 51: /* "equality_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 551 "MAliceParser.cpp"
	break;
      case 52: /* "and_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 560 "MAliceParser.cpp"
	break;
      case 53: /* "xor_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 569 "MAliceParser.cpp"
	break;
      case 54: /* "or_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 578 "MAliceParser.cpp"
	break;
      case 55: /* "assignment_expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 587 "MAliceParser.cpp"
	break;
      case 56: /* "decl" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 596 "MAliceParser.cpp"
	break;
      case 57: /* "expr" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 605 "MAliceParser.cpp"
	break;
      case 58: /* "expr_list" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 614 "MAliceParser.cpp"
	break;
      case 60: /* "stmt" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 623 "MAliceParser.cpp"
	break;
      case 62: /* "stmt_seq" */

/* Line 480 of lalr1.cc  */
#line 135 "alice.yy"
	{ };

/* Line 480 of lalr1.cc  */
#line 632 "MAliceParser.cpp"
	break;

	default:
	  break;
      }
  }

  void
  MAliceParser::yypop_ (unsigned int n)
  {
    yystate_stack_.pop (n);
    yysemantic_stack_.pop (n);
    yylocation_stack_.pop (n);
  }

#if YYDEBUG
  std::ostream&
  MAliceParser::debug_stream () const
  {
    return *yycdebug_;
  }

  void
  MAliceParser::set_debug_stream (std::ostream& o)
  {
    yycdebug_ = &o;
  }


  MAliceParser::debug_level_type
  MAliceParser::debug_level () const
  {
    return yydebug_;
  }

  void
  MAliceParser::set_debug_level (debug_level_type l)
  {
    yydebug_ = l;
  }
#endif

  int
  MAliceParser::parse ()
  {
    /// Lookahead and lookahead in internal form.
    int yychar = yyempty_;
    int yytoken = 0;

    /* State.  */
    int yyn;
    int yylen = 0;
    int yystate = 0;

    /* Error handling.  */
    int yynerrs_ = 0;
    int yyerrstatus_ = 0;

    /// Semantic value of the lookahead.
    semantic_type yylval;
    /// Location of the lookahead.
    location_type yylloc;
    /// The locations where the error started and ended.
    location_type yyerror_range[2];

    /// $$.
    semantic_type yyval;
    /// @$.
    location_type yyloc;

    int yyresult;

    YYCDEBUG << "Starting parse" << std::endl;


    /* User initialization code.  */
    
/* Line 553 of lalr1.cc  */
#line 7 "alice.yy"
{
	// @$.begin.filename = @$.end.filename = &driver.file;
}

/* Line 553 of lalr1.cc  */
#line 717 "MAliceParser.cpp"

    /* Initialize the stacks.  The initial state will be pushed in
       yynewstate, since the latter expects the semantical and the
       location values to have been already stored, initialize these
       stacks with a primary value.  */
    yystate_stack_ = state_stack_type (0);
    yysemantic_stack_ = semantic_stack_type (0);
    yylocation_stack_ = location_stack_type (0);
    yysemantic_stack_.push (yylval);
    yylocation_stack_.push (yylloc);

    /* New state.  */
  yynewstate:
    yystate_stack_.push (yystate);
    YYCDEBUG << "Entering state " << yystate << std::endl;

    /* Accept?  */
    if (yystate == yyfinal_)
      goto yyacceptlab;

    goto yybackup;

    /* Backup.  */
  yybackup:

    /* Try to take a decision without lookahead.  */
    yyn = yypact_[yystate];
    if (yyn == yypact_ninf_)
      goto yydefault;

    /* Read a lookahead token.  */
    if (yychar == yyempty_)
      {
	YYCDEBUG << "Reading a token: ";
	yychar = yylex (&yylval, &yylloc);
      }


    /* Convert token to internal form.  */
    if (yychar <= yyeof_)
      {
	yychar = yytoken = yyeof_;
	YYCDEBUG << "Now at end of input." << std::endl;
      }
    else
      {
	yytoken = yytranslate_ (yychar);
	YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
      }

    /* If the proper action on seeing token YYTOKEN is to reduce or to
       detect an error, take that action.  */
    yyn += yytoken;
    if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
      goto yydefault;

    /* Reduce or error.  */
    yyn = yytable_[yyn];
    if (yyn <= 0)
      {
	if (yyn == 0 || yyn == yytable_ninf_)
	goto yyerrlab;
	yyn = -yyn;
	goto yyreduce;
      }

    /* Shift the lookahead token.  */
    YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);

    /* Discard the token being shifted.  */
    yychar = yyempty_;

    yysemantic_stack_.push (yylval);
    yylocation_stack_.push (yylloc);

    /* Count tokens shifted since error; after three, turn off error
       status.  */
    if (yyerrstatus_)
      --yyerrstatus_;

    yystate = yyn;
    goto yynewstate;

  /*-----------------------------------------------------------.
  | yydefault -- do the default action for the current state.  |
  `-----------------------------------------------------------*/
  yydefault:
    yyn = yydefact_[yystate];
    if (yyn == 0)
      goto yyerrlab;
    goto yyreduce;

  /*-----------------------------.
  | yyreduce -- Do a reduction.  |
  `-----------------------------*/
  yyreduce:
    yylen = yyr2_[yyn];
    /* If YYLEN is nonzero, implement the default value of the action:
       `$$ = $1'.  Otherwise, use the top of the stack.

       Otherwise, the following line sets YYVAL to garbage.
       This behavior is undocumented and Bison
       users should not rely upon it.  */
    if (yylen)
      yyval = yysemantic_stack_[yylen - 1];
    else
      yyval = yysemantic_stack_[0];

    {
      slice<location_type, location_stack_type> slice (yylocation_stack_, yylen);
      YYLLOC_DEFAULT (yyloc, slice, yylen);
    }
    YY_REDUCE_PRINT (yyn);
    switch (yyn)
      {
	  case 2:

/* Line 678 of lalr1.cc  */
#line 165 "alice.yy"
    {
	(yyval.expr) = new ErrorAst("NotImplemented: bool_literal");
}
    break;

  case 3:

/* Line 678 of lalr1.cc  */
#line 168 "alice.yy"
    {
	 (yyval.expr) = new IntegerLiteralAst((yysemantic_stack_[(1) - (1)].i));
}
    break;

  case 4:

/* Line 678 of lalr1.cc  */
#line 171 "alice.yy"
    {
	 (yyval.expr) = new CharacterLiteralAst((yysemantic_stack_[(1) - (1)].c));
}
    break;

  case 5:

/* Line 678 of lalr1.cc  */
#line 174 "alice.yy"
    {
	 (yyval.expr) = new FloatLiteralAst((yysemantic_stack_[(1) - (1)].d));
}
    break;

  case 6:

/* Line 678 of lalr1.cc  */
#line 177 "alice.yy"
    {
	(yyval.expr) = new ErrorAst("NotImplemented: string_literal");
}
    break;

  case 7:

/* Line 678 of lalr1.cc  */
#line 183 "alice.yy"
    {
		(yyval.ast) = new TypeAst(*((yysemantic_stack_[(1) - (1)].s)));
}
    break;

  case 8:

/* Line 678 of lalr1.cc  */
#line 189 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 9:

/* Line 678 of lalr1.cc  */
#line 192 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(3) - (2)].expr);
}
    break;

  case 10:

/* Line 678 of lalr1.cc  */
#line 195 "alice.yy"
    {
	(yyval.expr) = new VariableAst(*((yysemantic_stack_[(1) - (1)].s)));
}
    break;

  case 11:

/* Line 678 of lalr1.cc  */
#line 201 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 12:

/* Line 678 of lalr1.cc  */
#line 204 "alice.yy"
    {
	(yyval.expr) = new UnaryAteOperatorAst((yysemantic_stack_[(2) - (1)].expr));
}
    break;

  case 13:

/* Line 678 of lalr1.cc  */
#line 207 "alice.yy"
    {
	(yyval.expr) = new UnaryDrankOperatorAst((yysemantic_stack_[(2) - (1)].expr));
}
    break;

  case 14:

/* Line 678 of lalr1.cc  */
#line 213 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 15:

/* Line 678 of lalr1.cc  */
#line 216 "alice.yy"
    {
	(yyval.expr) = new UnaryNegOperatorAst((yysemantic_stack_[(2) - (2)].expr));
}
    break;

  case 16:

/* Line 678 of lalr1.cc  */
#line 219 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(2) - (2)].expr);
}
    break;

  case 17:

/* Line 678 of lalr1.cc  */
#line 222 "alice.yy"
    {
	(yyval.expr) = new UnaryNotOperatorAst((yysemantic_stack_[(2) - (2)].expr));
}
    break;

  case 18:

/* Line 678 of lalr1.cc  */
#line 228 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 19:

/* Line 678 of lalr1.cc  */
#line 231 "alice.yy"
    {
	(yyval.expr) = new ErrorAst("NotImplemented");
}
    break;

  case 20:

/* Line 678 of lalr1.cc  */
#line 237 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 21:

/* Line 678 of lalr1.cc  */
#line 240 "alice.yy"
    {
	(yyval.expr) = new BinaryMulOperatorAst((yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr));
}
    break;

  case 22:

/* Line 678 of lalr1.cc  */
#line 243 "alice.yy"
    {
	(yyval.expr) = new BinaryDivOperatorAst((yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr));
}
    break;

  case 23:

/* Line 678 of lalr1.cc  */
#line 246 "alice.yy"
    {
	(yyval.expr) = new BinaryModOperatorAst((yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr));
}
    break;

  case 24:

/* Line 678 of lalr1.cc  */
#line 252 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 25:

/* Line 678 of lalr1.cc  */
#line 255 "alice.yy"
    {
	(yyval.expr) = new BinaryAddOperatorAst((yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr));
}
    break;

  case 26:

/* Line 678 of lalr1.cc  */
#line 258 "alice.yy"
    {
	(yyval.expr) = new BinarySubOperatorAst((yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr));
}
    break;

  case 27:

/* Line 678 of lalr1.cc  */
#line 264 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 28:

/* Line 678 of lalr1.cc  */
#line 267 "alice.yy"
    {
	(yyval.expr) = new ErrorAst("NotImplemented");
}
    break;

  case 29:

/* Line 678 of lalr1.cc  */
#line 270 "alice.yy"
    {
	(yyval.expr) = new ErrorAst("NotImplemented");
}
    break;

  case 30:

/* Line 678 of lalr1.cc  */
#line 276 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 31:

/* Line 678 of lalr1.cc  */
#line 279 "alice.yy"
    {
	(yyval.expr) = new ErrorAst("NotImplemented");
}
    break;

  case 32:

/* Line 678 of lalr1.cc  */
#line 282 "alice.yy"
    {
	(yyval.expr) = new ErrorAst("NotImplemented");
}
    break;

  case 33:

/* Line 678 of lalr1.cc  */
#line 285 "alice.yy"
    {
	(yyval.expr) = new ErrorAst("NotImplemented");
}
    break;

  case 34:

/* Line 678 of lalr1.cc  */
#line 288 "alice.yy"
    {
	(yyval.expr) = new ErrorAst("NotImplemented");
}
    break;

  case 35:

/* Line 678 of lalr1.cc  */
#line 294 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 36:

/* Line 678 of lalr1.cc  */
#line 297 "alice.yy"
    {
	(yyval.expr) = new ErrorAst("NotImplemented");
}
    break;

  case 37:

/* Line 678 of lalr1.cc  */
#line 300 "alice.yy"
    {
	(yyval.expr) = new ErrorAst("NotImplemented");
}
    break;

  case 38:

/* Line 678 of lalr1.cc  */
#line 306 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 39:

/* Line 678 of lalr1.cc  */
#line 309 "alice.yy"
    {
	(yyval.expr) = new BinaryAndOperatorAst((yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr));
}
    break;

  case 40:

/* Line 678 of lalr1.cc  */
#line 315 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 41:

/* Line 678 of lalr1.cc  */
#line 318 "alice.yy"
    {
	(yyval.expr) = new BinaryXorOperatorAst((yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr));
}
    break;

  case 42:

/* Line 678 of lalr1.cc  */
#line 324 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 43:

/* Line 678 of lalr1.cc  */
#line 327 "alice.yy"
    {
	(yyval.expr) = new BinaryOrOperatorAst((yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr));
}
    break;

  case 44:

/* Line 678 of lalr1.cc  */
#line 333 "alice.yy"
    {
	(yyval.expr) = new AssignmentOperatorAst(new VariableAst(*(yysemantic_stack_[(3) - (1)].s)), (yysemantic_stack_[(3) - (3)].expr));
}
    break;

  case 45:

/* Line 678 of lalr1.cc  */
#line 339 "alice.yy"
    {
	(yyval.expr) = new VariableDeclAst(*(yysemantic_stack_[(4) - (1)].s), (TypeAst*)(yysemantic_stack_[(4) - (4)].ast));
}
    break;

  case 46:

/* Line 678 of lalr1.cc  */
#line 342 "alice.yy"
    {
	(yyval.expr) = new VariableDeclAst(*(yysemantic_stack_[(5) - (1)].s), (TypeAst*)(yysemantic_stack_[(5) - (4)].ast));
}
    break;

  case 47:

/* Line 678 of lalr1.cc  */
#line 348 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 48:

/* Line 678 of lalr1.cc  */
#line 351 "alice.yy"
    {
	(yyval.expr) = (yysemantic_stack_[(1) - (1)].expr);
}
    break;

  case 49:

/* Line 678 of lalr1.cc  */
#line 354 "alice.yy"
    {
	(yyval.expr) = new ReturnExpressionAst((yysemantic_stack_[(3) - (3)].expr));
}
    break;

  case 50:

/* Line 678 of lalr1.cc  */
#line 360 "alice.yy"
    {
	(yyval.lists) = new ListAst((yysemantic_stack_[(1) - (1)].expr));
}
    break;

  case 51:

/* Line 678 of lalr1.cc  */
#line 363 "alice.yy"
    {
	(yyval.lists) = (yysemantic_stack_[(3) - (1)].lists)->adopt((yysemantic_stack_[(3) - (3)].expr));
}
    break;

  case 52:

/* Line 678 of lalr1.cc  */
#line 369 "alice.yy"
    {}
    break;

  case 53:

/* Line 678 of lalr1.cc  */
#line 370 "alice.yy"
    {}
    break;

  case 54:

/* Line 678 of lalr1.cc  */
#line 371 "alice.yy"
    {}
    break;

  case 55:

/* Line 678 of lalr1.cc  */
#line 375 "alice.yy"
    {
	(yyval.ast) = (yysemantic_stack_[(1) - (1)].lists);
}
    break;

  case 56:

/* Line 678 of lalr1.cc  */
#line 381 "alice.yy"
    {}
    break;

  case 57:

/* Line 678 of lalr1.cc  */
#line 382 "alice.yy"
    {}
    break;

  case 58:

/* Line 678 of lalr1.cc  */
#line 386 "alice.yy"
    {
	driver.put( (yyval.lists) = new ListAst((yysemantic_stack_[(1) - (1)].ast)) );
}
    break;

  case 59:

/* Line 678 of lalr1.cc  */
#line 389 "alice.yy"
    {
	driver.put( (yyval.lists) = (yysemantic_stack_[(3) - (1)].lists)->adopt((yysemantic_stack_[(3) - (3)].ast)) );
}
    break;



/* Line 678 of lalr1.cc  */
#line 1348 "MAliceParser.cpp"
	default:
          break;
      }
    YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);

    yypop_ (yylen);
    yylen = 0;
    YY_STACK_PRINT ();

    yysemantic_stack_.push (yyval);
    yylocation_stack_.push (yyloc);

    /* Shift the result of the reduction.  */
    yyn = yyr1_[yyn];
    yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
    if (0 <= yystate && yystate <= yylast_
	&& yycheck_[yystate] == yystate_stack_[0])
      yystate = yytable_[yystate];
    else
      yystate = yydefgoto_[yyn - yyntokens_];
    goto yynewstate;

  /*------------------------------------.
  | yyerrlab -- here on detecting error |
  `------------------------------------*/
  yyerrlab:
    /* If not already recovering from an error, report this error.  */
    if (!yyerrstatus_)
      {
	++yynerrs_;
	error (yylloc, yysyntax_error_ (yystate));
      }

    yyerror_range[0] = yylloc;
    if (yyerrstatus_ == 3)
      {
	/* If just tried and failed to reuse lookahead token after an
	 error, discard it.  */

	if (yychar <= yyeof_)
	  {
	  /* Return failure if at end of input.  */
	  if (yychar == yyeof_)
	    YYABORT;
	  }
	else
	  {
	    yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
	    yychar = yyempty_;
	  }
      }

    /* Else will try to reuse lookahead token after shifting the error
       token.  */
    goto yyerrlab1;


  /*---------------------------------------------------.
  | yyerrorlab -- error raised explicitly by YYERROR.  |
  `---------------------------------------------------*/
  yyerrorlab:

    /* Pacify compilers like GCC when the user code never invokes
       YYERROR and the label yyerrorlab therefore never appears in user
       code.  */
    if (false)
      goto yyerrorlab;

    yyerror_range[0] = yylocation_stack_[yylen - 1];
    /* Do not reclaim the symbols of the rule which action triggered
       this YYERROR.  */
    yypop_ (yylen);
    yylen = 0;
    yystate = yystate_stack_[0];
    goto yyerrlab1;

  /*-------------------------------------------------------------.
  | yyerrlab1 -- common code for both syntax error and YYERROR.  |
  `-------------------------------------------------------------*/
  yyerrlab1:
    yyerrstatus_ = 3;	/* Each real token shifted decrements this.  */

    for (;;)
      {
	yyn = yypact_[yystate];
	if (yyn != yypact_ninf_)
	{
	  yyn += yyterror_;
	  if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
	    {
	      yyn = yytable_[yyn];
	      if (0 < yyn)
		break;
	    }
	}

	/* Pop the current state because it cannot handle the error token.  */
	if (yystate_stack_.height () == 1)
	YYABORT;

	yyerror_range[0] = yylocation_stack_[0];
	yydestruct_ ("Error: popping",
		     yystos_[yystate],
		     &yysemantic_stack_[0], &yylocation_stack_[0]);
	yypop_ ();
	yystate = yystate_stack_[0];
	YY_STACK_PRINT ();
      }

    yyerror_range[1] = yylloc;
    // Using YYLLOC is tempting, but would change the location of
    // the lookahead.  YYLOC is available though.
    YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
    yysemantic_stack_.push (yylval);
    yylocation_stack_.push (yyloc);

    /* Shift the error token.  */
    YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
		     &yysemantic_stack_[0], &yylocation_stack_[0]);

    yystate = yyn;
    goto yynewstate;

    /* Accept.  */
  yyacceptlab:
    yyresult = 0;
    goto yyreturn;

    /* Abort.  */
  yyabortlab:
    yyresult = 1;
    goto yyreturn;

  yyreturn:
    if (yychar != yyempty_)
      yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);

    /* Do not reclaim the symbols of the rule which action triggered
       this YYABORT or YYACCEPT.  */
    yypop_ (yylen);
    while (yystate_stack_.height () != 1)
      {
	yydestruct_ ("Cleanup: popping",
		   yystos_[yystate_stack_[0]],
		   &yysemantic_stack_[0],
		   &yylocation_stack_[0]);
	yypop_ ();
      }

    return yyresult;
  }

  // Generate an error message.
  std::string
  MAliceParser::yysyntax_error_ (int yystate)
  {
    std::string res;
    YYUSE (yystate);
#if YYERROR_VERBOSE
    int yyn = yypact_[yystate];
    if (yypact_ninf_ < yyn && yyn <= yylast_)
      {
	/* Start YYX at -YYN if negative to avoid negative indexes in
	   YYCHECK.  */
	int yyxbegin = yyn < 0 ? -yyn : 0;

	/* Stay within bounds of both yycheck and yytname.  */
	int yychecklim = yylast_ - yyn + 1;
	int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
	int count = 0;
	for (int x = yyxbegin; x < yyxend; ++x)
	  if (yycheck_[x + yyn] == x && x != yyterror_)
	    ++count;

	// FIXME: This method of building the message is not compatible
	// with internationalization.  It should work like yacc.c does it.
	// That is, first build a string that looks like this:
	// "syntax error, unexpected %s or %s or %s"
	// Then, invoke YY_ on this string.
	// Finally, use the string as a format to output
	// yytname_[tok], etc.
	// Until this gets fixed, this message appears in English only.
	res = "syntax error, unexpected ";
	res += yytnamerr_ (yytname_[tok]);
	if (count < 5)
	  {
	    count = 0;
	    for (int x = yyxbegin; x < yyxend; ++x)
	      if (yycheck_[x + yyn] == x && x != yyterror_)
		{
		  res += (!count++) ? ", expecting " : " or ";
		  res += yytnamerr_ (yytname_[x]);
		}
	  }
      }
    else
#endif
      res = YY_("syntax error");
    return res;
  }


  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
     STATE-NUM.  */
  const signed char MAliceParser::yypact_ninf_ = -28;
  const signed char
  MAliceParser::yypact_[] =
  {
         7,    25,     4,   -28,   -28,   -28,    -5,   -28,     3,     1,
      10,     1,   -28,   -28,   -28,     7,   -28,   -28,   -28,     7,
     -28,   -28,   -28,   -28,   -28,   -28,     9,     1,     1,     1,
     -28,   -28,    -2,   -28,   -28,    -8,    18,    44,     2,    42,
     -13,     8,    -3,    37,    -3,   -28,   -28,    25,    12,    27,
     -28,   -28,   -28,   -28,   -28,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,   -28,    43,     1,   -28,   -28,   -28,   -28,    -8,    -8,
      18,    18,    44,    44,    44,    44,     2,     2,    42,   -13,
       8,   -28,   -28
  };

  /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
     doesn't specify something else to do.  Zero means the default is an
     error.  */
  const unsigned char
  MAliceParser::yydefact_[] =
  {
         0,     0,     0,    48,    47,    50,    55,    58,     0,     0,
       0,     0,    52,    53,    54,     0,     1,    57,    56,     0,
      10,     2,     4,     3,     5,     6,     0,     0,     0,     0,
       8,    11,    14,    18,    20,    24,    27,    30,    35,    38,
      40,    42,    44,     0,    49,    51,    59,     7,     0,     0,
      15,    16,    17,    12,    13,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     7,    45,     0,     9,    21,    22,    23,    26,    25,
      28,    29,    33,    34,    31,    32,    36,    37,    39,    41,
      43,    46,    19
  };

  /* YYPGOTO[NTERM-NUM].  */
  const signed char
  MAliceParser::yypgoto_[] =
  {
       -28,   -28,    21,   -28,   -28,   -28,   -27,    -1,     0,   -15,
      -4,     6,    11,    13,    55,   -28,   -28,     5,   -28,   -28,
      48,   -28,   -28
  };

  /* YYDEFGOTO[NTERM-NUM].  */
  const signed char
  MAliceParser::yydefgoto_[] =
  {
        -1,    30,    48,    31,    32,    33,    34,    35,    36,    37,
      38,    39,    40,    41,    42,     3,     4,     5,     6,    15,
       7,    19,     8
  };

  /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
     positive, shift that token.  If negative, reduce the rule which
     number is the opposite.  If zero, do what YYDEFACT says.  */
  const signed char MAliceParser::yytable_ninf_ = -1;
  const unsigned char
  MAliceParser::yytable_[] =
  {
        50,    51,    52,    16,    20,    21,    22,    23,    24,    25,
       1,    12,    47,    62,    63,    68,    13,    55,    56,    57,
      45,    53,    54,    11,     2,    43,     2,    70,    75,    76,
      77,    49,    26,    14,    27,    28,    29,    69,    64,    65,
      71,    17,    18,     9,    73,    10,    92,    82,    83,    84,
      85,    58,    59,    60,    61,    66,    67,    78,    79,    74,
      80,    81,    86,    87,    72,    91,    44,    46,     0,     0,
       0,     0,     0,     0,    88,     0,     0,     0,     0,     0,
      89,     0,     0,    90
  };

  /* YYCHECK.  */
  const signed char
  MAliceParser::yycheck_[] =
  {
        27,    28,    29,     0,     3,     4,     5,     6,     7,     8,
       3,    16,     3,    11,    12,    28,    21,    25,    26,    27,
      15,    23,    24,    19,    17,    15,    17,    30,    55,    56,
      57,    26,    31,    38,    33,    34,    35,    29,    36,    37,
       3,    38,    39,    18,    32,    20,    73,    62,    63,    64,
      65,    33,    34,     9,    10,    13,    14,    58,    59,    32,
      60,    61,    66,    67,    43,    22,    11,    19,    -1,    -1,
      -1,    -1,    -1,    -1,    68,    -1,    -1,    -1,    -1,    -1,
      69,    -1,    -1,    70
  };

  /* STOS_[STATE-NUM] -- The (internal number of the) accessing
     symbol of state STATE-NUM.  */
  const unsigned char
  MAliceParser::yystos_[] =
  {
         0,     3,    17,    55,    56,    57,    58,    60,    62,    18,
      20,    19,    16,    21,    38,    59,     0,    38,    39,    61,
       3,     4,     5,     6,     7,     8,    31,    33,    34,    35,
      41,    43,    44,    45,    46,    47,    48,    49,    50,    51,
      52,    53,    54,    15,    54,    57,    60,     3,    42,    57,
      46,    46,    46,    23,    24,    25,    26,    27,    33,    34,
       9,    10,    11,    12,    36,    37,    13,    14,    28,    29,
      30,     3,    42,    32,    32,    46,    46,    46,    47,    47,
      48,    48,    49,    49,    49,    49,    50,    50,    51,    52,
      53,    22,    46
  };

#if YYDEBUG
  /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
     to YYLEX-NUM.  */
  const unsigned short int
  MAliceParser::yytoken_number_[] =
  {
         0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
     275,   276,   277,   278,   279,    42,    47,    37,    38,    94,
     124,    40,    41,    45,    43,   126,    60,    62,    44,    46
  };
#endif

  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
  const unsigned char
  MAliceParser::yyr1_[] =
  {
         0,    40,    41,    41,    41,    41,    41,    42,    43,    43,
      43,    44,    44,    44,    45,    45,    45,    45,    46,    46,
      47,    47,    47,    47,    48,    48,    48,    49,    49,    49,
      50,    50,    50,    50,    50,    51,    51,    51,    52,    52,
      53,    53,    54,    54,    55,    56,    56,    57,    57,    57,
      58,    58,    59,    59,    59,    60,    61,    61,    62,    62
  };

  /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
  const unsigned char
  MAliceParser::yyr2_[] =
  {
         0,     2,     1,     1,     1,     1,     1,     1,     1,     3,
       1,     1,     2,     2,     1,     2,     2,     2,     1,     4,
       1,     3,     3,     3,     1,     3,     3,     1,     3,     3,
       1,     3,     3,     3,     3,     1,     3,     3,     1,     3,
       1,     3,     1,     3,     3,     4,     5,     1,     1,     3,
       1,     3,     1,     1,     1,     1,     1,     1,     1,     3
  };

#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
     First, the terminals, then, starting at \a yyntokens_, nonterminals.  */
  const char*
  const MAliceParser::yytname_[] =
  {
    "\"End Of Line\"", "error", "$undefined", "\"id\"", "\"bool\"",
  "\"char\"", "\"int\"", "\"float\"", "\"string\"", "\"<<\"", "\">>\"",
  "\"<=\"", "\">=\"", "\"==\"", "\"!=\"", "\"a\"", "\"and\"", "\"Alice\"",
  "\"became\"", "\"found\"", "\"was\"", "\"but\"", "\"too\"", "\"ate\"",
  "\"drank\"", "'*'", "'/'", "'%'", "'&'", "'^'", "'|'", "'('", "')'",
  "'-'", "'+'", "'~'", "'<'", "'>'", "','", "'.'", "$accept", "literal",
  "type_id", "primary_expr", "postfix_expr", "unary_expr", "cast_expr",
  "multiplicative_expr", "additive_expr", "shift_expr", "relational_expr",
  "equality_expr", "and_expr", "xor_expr", "or_expr", "assignment_expr",
  "decl", "expr", "expr_list", "expr_list_sep", "stmt", "stmt_term",
  "stmt_seq", 0
  };
#endif

#if YYDEBUG
  /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
  const MAliceParser::rhs_number_type
  MAliceParser::yyrhs_[] =
  {
        62,     0,    -1,     4,    -1,     6,    -1,     5,    -1,     7,
      -1,     8,    -1,     3,    -1,    41,    -1,    31,    57,    32,
      -1,     3,    -1,    43,    -1,    44,    23,    -1,    44,    24,
      -1,    44,    -1,    33,    46,    -1,    34,    46,    -1,    35,
      46,    -1,    45,    -1,    31,    42,    32,    46,    -1,    46,
      -1,    47,    25,    46,    -1,    47,    26,    46,    -1,    47,
      27,    46,    -1,    47,    -1,    48,    34,    47,    -1,    48,
      33,    47,    -1,    48,    -1,    49,     9,    48,    -1,    49,
      10,    48,    -1,    49,    -1,    50,    36,    49,    -1,    50,
      37,    49,    -1,    50,    11,    49,    -1,    50,    12,    49,
      -1,    50,    -1,    51,    13,    50,    -1,    51,    14,    50,
      -1,    51,    -1,    52,    28,    51,    -1,    52,    -1,    53,
      29,    52,    -1,    53,    -1,    54,    30,    53,    -1,     3,
      18,    54,    -1,     3,    20,    15,    42,    -1,     3,    20,
      15,    42,    22,    -1,    56,    -1,    55,    -1,    17,    19,
      54,    -1,    57,    -1,    58,    59,    57,    -1,    16,    -1,
      21,    -1,    38,    -1,    58,    -1,    39,    -1,    38,    -1,
      60,    -1,    62,    61,    60,    -1
  };

  /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
     YYRHS.  */
  const unsigned char
  MAliceParser::yyprhs_[] =
  {
         0,     0,     3,     5,     7,     9,    11,    13,    15,    17,
      21,    23,    25,    28,    31,    33,    36,    39,    42,    44,
      49,    51,    55,    59,    63,    65,    69,    73,    75,    79,
      83,    85,    89,    93,    97,   101,   103,   107,   111,   113,
     117,   119,   123,   125,   129,   133,   138,   144,   146,   148,
     152,   154,   158,   160,   162,   164,   166,   168,   170,   172
  };

  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
  const unsigned short int
  MAliceParser::yyrline_[] =
  {
         0,   165,   165,   168,   171,   174,   177,   183,   189,   192,
     195,   201,   204,   207,   213,   216,   219,   222,   228,   231,
     237,   240,   243,   246,   252,   255,   258,   264,   267,   270,
     276,   279,   282,   285,   288,   294,   297,   300,   306,   309,
     315,   318,   324,   327,   333,   339,   342,   348,   351,   354,
     360,   363,   369,   370,   371,   375,   381,   382,   386,   389
  };

  // Print the state stack on the debug stream.
  void
  MAliceParser::yystack_print_ ()
  {
    *yycdebug_ << "Stack now";
    for (state_stack_type::const_iterator i = yystate_stack_.begin ();
	 i != yystate_stack_.end (); ++i)
      *yycdebug_ << ' ' << *i;
    *yycdebug_ << std::endl;
  }

  // Report on the debug stream that the rule \a yyrule is going to be reduced.
  void
  MAliceParser::yy_reduce_print_ (int yyrule)
  {
    unsigned int yylno = yyrline_[yyrule];
    int yynrhs = yyr2_[yyrule];
    /* Print the symbols being reduced, and their result.  */
    *yycdebug_ << "Reducing stack by rule " << yyrule - 1
	       << " (line " << yylno << "):" << std::endl;
    /* The symbols being reduced.  */
    for (int yyi = 0; yyi < yynrhs; yyi++)
      YY_SYMBOL_PRINT ("   $" << yyi + 1 << " =",
		       yyrhs_[yyprhs_[yyrule] + yyi],
		       &(yysemantic_stack_[(yynrhs) - (yyi + 1)]),
		       &(yylocation_stack_[(yynrhs) - (yyi + 1)]));
  }
#endif // YYDEBUG

  /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
  MAliceParser::token_number_type
  MAliceParser::yytranslate_ (int t)
  {
    static
    const token_number_type
    translate_table[] =
    {
           0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,    27,    28,     2,
      31,    32,    25,    34,    38,    33,    39,    26,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
      36,     2,    37,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,    29,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,    30,     2,    35,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24
    };
    if ((unsigned int) t <= yyuser_token_number_max_)
      return translate_table[t];
    else
      return yyundef_token_;
  }

  const int MAliceParser::yyeof_ = 0;
  const int MAliceParser::yylast_ = 83;
  const int MAliceParser::yynnts_ = 23;
  const int MAliceParser::yyempty_ = -2;
  const int MAliceParser::yyfinal_ = 16;
  const int MAliceParser::yyterror_ = 1;
  const int MAliceParser::yyerrcode_ = 256;
  const int MAliceParser::yyntokens_ = 40;

  const unsigned int MAliceParser::yyuser_token_number_max_ = 279;
  const MAliceParser::token_number_type MAliceParser::yyundef_token_ = 2;


/* Line 1054 of lalr1.cc  */
#line 1 "[Bison:b4_percent_define_default]"

} // yy

/* Line 1054 of lalr1.cc  */
#line 1853 "MAliceParser.cpp"


/* Line 1056 of lalr1.cc  */
#line 395 "alice.yy"


void yy::MAliceParser::error(yy::location const& loc, std::string const& msg)
{
	std::cerr << loc << ":" << msg << std::endl;
}



